package com.sg.business.visualization.ui;

import java.util.Calendar;
import java.util.Date;

import org.eclipse.swt.widgets.Shell;

import com.sg.widgets.commons.selector.DateFromToSelector;

public class DoubleDateSelectorDialog extends DateFromToSelector {

	public DoubleDateSelectorDialog(Shell parentShell) {
		super(parentShell);
	}

	@Override
	public Date[] getDate() {
		Date[] dates = super.getDate();
		Calendar c = Calendar.getInstance();
		if (dates == null) {
			dates = new Date[2];
			dates[0] = c.getTime();
			dates[1] = c.getTime();
		} else if (dates[0] == null) {
			dates[0] = c.getTime();
		} else if (dates[1] == null) {
			dates[1] = c.getTime();
		}
		return dates;
	}
}
